package com.it.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.it.mapper.LogMapper;
import com.it.pojo.ApprovalRequest;
import com.it.pojo.Log;
import com.it.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogSerivceImpl extends ServiceImpl<LogMapper, Log> implements LogService {
    @Autowired
    private LogMapper logMapper;
    @Override
    public boolean postLogs(Log log) {
        int insert = logMapper.insert(log);
        return insert != 0;
    }

    @Override
    public boolean deleteLog(ApprovalRequest request) {
        LambdaQueryWrapper<Log> lqw = new LambdaQueryWrapper<>();
        lqw.eq(Log::getId,request.getLogId());
        return logMapper.deleteById(lqw)!= 0;

    }


}
